<?php
require_once '../../../zb_system/function/c_system_base.php';
require_once '../../../zb_system/function/c_system_admin.php';
$zbp->Load();
$action = 'root';
if (!$zbp->CheckRights($action)) {$zbp->ShowError(6);die();}
if (!$zbp->CheckPlugin('AliyunOSS')) {$zbp->ShowError(48);die();}
$blogtitle='阿里云存储';

  if(isset($_POST['thumb_width'])){
    $zbp->Config('AliyunOSS')->thumb_width=$_POST['thumb_width'];
    $zbp->Config('AliyunOSS')->thumb_height=$_POST['thumb_height'];
    $zbp->Config('AliyunOSS')->thumb_cut=$_POST['thumb_cut'];
    $zbp->Config('AliyunOSS')->thumb_proportion=$_POST['thumb_proportion'];
    $zbp->SaveConfig('AliyunOSS');
    $zbp->SetHint('good');
    Redirect('./thumbnail.php');
  }

require $blogpath . 'zb_system/admin/admin_header.php';
?>
<link rel="stylesheet" type="text/css" href="style.css"/>
<?php
require $blogpath . 'zb_system/admin/admin_top.php';
?>
<div id="divMain">
  <div class="divHeader"><?php echo $blogtitle;?></div>
  <div class="SubMenu">
    <a href="main.php" ><span class="m-left">阿里云账户</span></a>
    <a href="Watermark.php" ><span class="m-left">水印设置</span></a>
    <a href="thumbnail.php" ><span class="m-left">缩略图设置</span></a>
    <a href="https://me.alipay.com/zrcs" target="_blank"><span class="m-left" style="color:#F00">赞助</span></a>
    <a href="http://www.fengwensheng.com/" target="_blank"><span class="m-right">帮助</span></a>
  </div>
  <div id="divMain2">
  <p>缩略图不直接适用于文章，必须在模板中调用。模板调用代码和FirstImg插件相同 使用FirstImg很容易过度到本插件</p>
    <form id="form-postsubmit" name="form-postsubmit" method="post" action="thumbnail.php">
      <table width="100%" style="padding:0px;margin:0px;" cellspacing="0" cellpadding="0" class="tableBorder">
        <tr>
          <th width="30%"><p align="center">设置</p></th>
          <th width="60%"><p align="center">内容</p></th>
        </tr>
        <tr>
          <td><p><b>· 缩略图宽度</b><br/>
              <span class="note">&nbsp;缩略图宽{0:此时目标高度不能为0，目标宽度为源图宽*(目标高度/源图高)}</p></td>
          <td><input type="number" id="thumb_width" name="thumb_width" value="<?php echo $zbp->Config('AliyunOSS')->thumb_width?>" /></td>
        </tr>
        <tr>
          <td><p><b>· 缩略图高度</b><br/>
              <span class="note">&nbsp;缩略图高{0:此时目标宽度不能为0，目标高度为源图高*(目标宽度/源图宽)}</p></td>
          <td><input type="number" id="thumb_height" name="thumb_height" value="<?php echo $zbp->Config('AliyunOSS')->thumb_height?>" /></td>
        </tr>
        <tr>
          <td><p><b>· 缩略图缩放</b><br/>
              <span class="note">&nbsp;0:不缩放, 0-->1:缩放到相应比例(此时宽高限制和裁切均失效)</p></td>
          <td><input type="number" id="thumb_proportion" name="thumb_proportion" value="<?php echo $zbp->Config('AliyunOSS')->thumb_proportion?>" /></td>
        </tr>
        <tr>
          <td><p><b>· 缩略图裁剪</b><br/>
              <span class="note">&nbsp;打开则进行等比缩放后，居中裁剪；关闭则等比缩放后某一边可能超出长度。</p></td>
          <td><input type="text" class="checkbox" id="thumb_cut" name="thumb_cut" value="<?php echo $zbp->Config('AliyunOSS')->thumb_cut?>" /></td>
        </tr>
      </table>
      <br />
      <input name="" type="submit" class="button" value="保存"/>
      <br />
      <br />
    </form>
  </div>
</div>
<script type="text/javascript">AddHeaderIcon("<?php echo $bloghost . 'zb_users/plugin/AliyunOSS/logo.png';?>");</script>
<script type="text/javascript">
ActiveTopMenu("topmenu_AliyunOSS");
</script> 
<?php
require $blogpath . 'zb_system/admin/admin_footer.php';
RunTime();
?>
